<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>sock: E:/git/sock/sock/http/http_server.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sock
   &#160;<span id="projectnumber">v0.11</span>
   </div>
   <div id="projectbrief">C++ Network Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_99ede9081e3122cb31ab1bd7b142cd6c.html">sock</a></li><li class="navelem"><a class="el" href="dir_7c33e989e8c050d7b2ba91a16c41033d.html">sock</a></li><li class="navelem"><a class="el" href="dir_2a6edac14fe64ddd5f5b32a053fdeecc.html">http</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">http_server.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="http__server_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Name         : http_server.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Author       : 671643387</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Date         : 2015年10月10日</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Description  :</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef SOCK_HTTP_HTTP_SERVER_H_</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define SOCK_HTTP_HTTP_SERVER_H_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;boost/noncopyable.hpp&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;boost/function.hpp&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;boost/unordered_map.hpp&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="tcp__server_8h.html">sock/net/tcp_server.h</a>&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="http__request__factory_8h.html">sock/http/http_request_factory.h</a>&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="http__request__parser_8h.html">sock/http/http_request_parser.h</a>&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="http__session_8h.html">sock/http/http_session.h</a>&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="http__session__factory_8h.html">sock/http/http_session_factory.h</a>&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacesock.html">sock</a></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keyword">namespace </span>http</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    {</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html">   27</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classsock_1_1http_1_1_http_server.html">HttpServer</a> : <span class="keyword">public</span> boost::noncopyable</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#a860fd0abc2724910c69ef3629c534b2c">   30</a></span>&#160;            <span class="keyword">typedef</span> boost::function&lt;void(const HttpRequestPtr&amp;, const HttpResponsePtr&amp;)&gt; <a class="code" href="classsock_1_1http_1_1_http_server.html#a860fd0abc2724910c69ef3629c534b2c">RequestCompletedFN</a>;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#afd6c916273b2c92b0b478722480c77b3">   31</a></span>&#160;            <span class="keyword">typedef</span> boost::function&lt;void(const HttpRequestPtr&amp;, const HttpResponsePtr&amp;, RequestCompletedFN)&gt; <a class="code" href="classsock_1_1http_1_1_http_server.html#afd6c916273b2c92b0b478722480c77b3">RequestHandler</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structsock_1_1http_1_1_http_server_1_1_statics.html">   36</a></span>&#160;            <span class="keyword">struct </span><a class="code" href="structsock_1_1http_1_1_http_server_1_1_statics.html">Statics</a></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;            {</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structsock_1_1http_1_1_http_server_1_1_statics.html#a693fd63e87979b48a3553e61d4db10ca">   38</a></span>&#160;                <a class="code" href="structsock_1_1net_1_1_tcp_server_1_1_statics.html">sock::net::TcpServer::Statics</a> <a class="code" href="structsock_1_1http_1_1_http_server_1_1_statics.html#a693fd63e87979b48a3553e61d4db10ca">tcpServerStatics</a>;     <span class="comment">/* 内部TCP服务器状态 */</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            };</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            <span class="keyword">enum</span> State</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            {</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;                READY,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                RUNNING,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                EXITING,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                EXIT</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            };</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            <a class="code" href="classsock_1_1http_1_1_http_server.html#abad0ccb06e49327aad09f5f9e18087be">HttpServer</a>(<a class="code" href="namespacesock_1_1net.html#a2ddc58693b405832076a3d76dc133671">sock::net::TcpConnectionFactoryPtr</a> connectionFactory = <a class="code" href="namespacesock_1_1net.html#a2ddc58693b405832076a3d76dc133671">sock::net::TcpConnectionFactoryPtr</a>(<span class="keyword">new</span> <a class="code" href="classsock_1_1net_1_1_tcp_connection_factory.html">sock::net::TcpConnectionFactory</a>()));</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            <a class="code" href="classsock_1_1http_1_1_http_server.html#a14fb5346b90163686c1172b5a7e1b19a">~HttpServer</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#a480de2e6bc2bf1020080da6bc270f52d">open</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* addr, <span class="keywordtype">int</span> port, <span class="keywordtype">int</span> backlog);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#a673124e65ae935396d49293dfba7a186">run</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#ab1d4688c1a099c825847260c070a9770">stop</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#a34320f47f8e0b53b73d391d7be5d19b1">   76</a></span>&#160;            <a class="code" href="classsock_1_1net_1_1_tcp_server.html">sock::net::TcpServer</a>&amp; <a class="code" href="classsock_1_1http_1_1_http_server.html#a34320f47f8e0b53b73d391d7be5d19b1">getTcpServer</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> tcpServer_; }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#afcf96c05483817ee22bd4969bb0c7339">   82</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#afcf96c05483817ee22bd4969bb0c7339">setSessionFactory</a>(<a class="code" href="namespacesock_1_1http.html#ab40d42e06f9b067d13943821f928e62e">HttpSessionFactoryPtr</a> factory) { assert(state_ == READY); sessionFactory_ = factory; }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#a631a67f2cd6d9480cde15f3cc2d8bcfd">   88</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#a631a67f2cd6d9480cde15f3cc2d8bcfd">setRequestFactory</a>(<a class="code" href="namespacesock_1_1http.html#a109e52a7c286a1054ad5fe134a97ec09">HttpRequestFactoryPtr</a> factory) { assert(state_ == READY); requestFactory_ = factory; }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#af09722646b93b373a1b79d6b9a806093">   94</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#af09722646b93b373a1b79d6b9a806093">setRequestParser</a>(<a class="code" href="namespacesock_1_1http.html#a10bd924b8a80c730376bfab54559cbcf">HttpRequestParserPtr</a> parser) { assert(state_ == READY); requestParser_ = parser; }</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#ab0f2bba4a15f790e18d186836d660f37">  100</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#ab0f2bba4a15f790e18d186836d660f37">setRequestHandler</a>(RequestHandler handler) { assert(state_ == READY); requestHandler_ = handler; }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classsock_1_1http_1_1_http_server.html#a50abc26a9889ac12ca9915a58d9e53d4">getStatics</a>(Statics&amp; statics);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            <span class="keywordtype">void</span> onConnectionEstablished(<a class="code" href="namespacesock_1_1net.html#ac7ab8c7fe4e8e023f2fea799b74122ed">sock::net::TcpConnectionPtr</a>&amp; conn);</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            <span class="keywordtype">void</span> onConnectionClose(<a class="code" href="classsock_1_1net_1_1_tcp_connection.html">sock::net::TcpConnection</a>&amp; conn);</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            <span class="keyword">typedef</span> boost::unordered_map&lt;int, HttpSessionPtr&gt; SessionMap;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classsock_1_1http_1_1_http_server.html#a3e611175a551b64dda26f513067e0d04">  116</a></span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classsock_1_1http_1_1_http_session.html">HttpSession</a>;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;            <span class="keywordtype">int</span> sessionIdGen_;                          <span class="comment">/* Session ID 分配 */</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;            State state_;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            <a class="code" href="classsock_1_1net_1_1_tcp_server.html">sock::net::TcpServer</a> tcpServer_;            <span class="comment">/* 内部TCP服务器 */</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            SessionMap sessions_;                       <span class="comment">/* Session map */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <a class="code" href="namespacesock_1_1http.html#ab40d42e06f9b067d13943821f928e62e">HttpSessionFactoryPtr</a> sessionFactory_;      <span class="comment">/* Session 工厂 */</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <a class="code" href="namespacesock_1_1http.html#a109e52a7c286a1054ad5fe134a97ec09">HttpRequestFactoryPtr</a> requestFactory_;      <span class="comment">/* 请求工厂 */</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <a class="code" href="namespacesock_1_1http.html#a10bd924b8a80c730376bfab54559cbcf">HttpRequestParserPtr</a> requestParser_;        <span class="comment">/* 请求解析器 */</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;            RequestHandler requestHandler_;             <span class="comment">/* 请求处理器 */</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        };</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    }</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;}</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SOCK_HTTP_HTTP_SERVER_H_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="structsock_1_1net_1_1_tcp_server_1_1_statics_html"><div class="ttname"><a href="structsock_1_1net_1_1_tcp_server_1_1_statics.html">sock::net::TcpServer::Statics</a></div><div class="ttdoc">状态信息 </div><div class="ttdef"><b>Definition:</b> tcp_server.h:61</div></div>
<div class="ttc" id="tcp__server_8h_html"><div class="ttname"><a href="tcp__server_8h.html">tcp_server.h</a></div></div>
<div class="ttc" id="structsock_1_1http_1_1_http_server_1_1_statics_html"><div class="ttname"><a href="structsock_1_1http_1_1_http_server_1_1_statics.html">sock::http::HttpServer::Statics</a></div><div class="ttdoc">状态 </div><div class="ttdef"><b>Definition:</b> http_server.h:36</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_abad0ccb06e49327aad09f5f9e18087be"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#abad0ccb06e49327aad09f5f9e18087be">sock::http::HttpServer::HttpServer</a></div><div class="ttdeci">HttpServer(sock::net::TcpConnectionFactoryPtr connectionFactory=sock::net::TcpConnectionFactoryPtr(new sock::net::TcpConnectionFactory()))</div><div class="ttdef"><b>Definition:</b> http_server.cc:14</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a14fb5346b90163686c1172b5a7e1b19a"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a14fb5346b90163686c1172b5a7e1b19a">sock::http::HttpServer::~HttpServer</a></div><div class="ttdeci">~HttpServer(void)</div><div class="ttdef"><b>Definition:</b> http_server.cc:31</div></div>
<div class="ttc" id="namespacesock_1_1http_html_a109e52a7c286a1054ad5fe134a97ec09"><div class="ttname"><a href="namespacesock_1_1http.html#a109e52a7c286a1054ad5fe134a97ec09">sock::http::HttpRequestFactoryPtr</a></div><div class="ttdeci">boost::shared_ptr&lt; HttpRequestFactory &gt; HttpRequestFactoryPtr</div><div class="ttdef"><b>Definition:</b> http_request_factory.h:42</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a631a67f2cd6d9480cde15f3cc2d8bcfd"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a631a67f2cd6d9480cde15f3cc2d8bcfd">sock::http::HttpServer::setRequestFactory</a></div><div class="ttdeci">void setRequestFactory(HttpRequestFactoryPtr factory)</div><div class="ttdoc">设置请求工厂 </div><div class="ttdef"><b>Definition:</b> http_server.h:88</div></div>
<div class="ttc" id="http__session_8h_html"><div class="ttname"><a href="http__session_8h.html">http_session.h</a></div></div>
<div class="ttc" id="namespacesock_1_1net_html_ac7ab8c7fe4e8e023f2fea799b74122ed"><div class="ttname"><a href="namespacesock_1_1net.html#ac7ab8c7fe4e8e023f2fea799b74122ed">sock::net::TcpConnectionPtr</a></div><div class="ttdeci">boost::shared_ptr&lt; TcpConnection &gt; TcpConnectionPtr</div><div class="ttdef"><b>Definition:</b> tcp_connection.h:158</div></div>
<div class="ttc" id="classsock_1_1net_1_1_tcp_connection_factory_html"><div class="ttname"><a href="classsock_1_1net_1_1_tcp_connection_factory.html">sock::net::TcpConnectionFactory</a></div><div class="ttdoc">网络连接工厂类 </div><div class="ttdef"><b>Definition:</b> tcp_connection_factory.h:22</div></div>
<div class="ttc" id="namespacesock_1_1http_html_a10bd924b8a80c730376bfab54559cbcf"><div class="ttname"><a href="namespacesock_1_1http.html#a10bd924b8a80c730376bfab54559cbcf">sock::http::HttpRequestParserPtr</a></div><div class="ttdeci">boost::shared_ptr&lt; HttpRequestParser &gt; HttpRequestParserPtr</div><div class="ttdef"><b>Definition:</b> http_request_parser.h:39</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a50abc26a9889ac12ca9915a58d9e53d4"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a50abc26a9889ac12ca9915a58d9e53d4">sock::http::HttpServer::getStatics</a></div><div class="ttdeci">void getStatics(Statics &amp;statics)</div><div class="ttdoc">获取服务器状态 </div><div class="ttdef"><b>Definition:</b> http_server.cc:55</div></div>
<div class="ttc" id="classsock_1_1net_1_1_tcp_connection_html"><div class="ttname"><a href="classsock_1_1net_1_1_tcp_connection.html">sock::net::TcpConnection</a></div><div class="ttdoc">网络连接 </div><div class="ttdef"><b>Definition:</b> tcp_connection.h:27</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_session_html"><div class="ttname"><a href="classsock_1_1http_1_1_http_session.html">sock::http::HttpSession</a></div><div class="ttdoc">HTTP Session. </div><div class="ttdef"><b>Definition:</b> http_session.h:28</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_ab1d4688c1a099c825847260c070a9770"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#ab1d4688c1a099c825847260c070a9770">sock::http::HttpServer::stop</a></div><div class="ttdeci">void stop(void)</div><div class="ttdoc">停止服务器 </div><div class="ttdef"><b>Definition:</b> http_server.cc:49</div></div>
<div class="ttc" id="namespacesock_1_1http_html_ab40d42e06f9b067d13943821f928e62e"><div class="ttname"><a href="namespacesock_1_1http.html#ab40d42e06f9b067d13943821f928e62e">sock::http::HttpSessionFactoryPtr</a></div><div class="ttdeci">boost::shared_ptr&lt; HttpSessionFactory &gt; HttpSessionFactoryPtr</div><div class="ttdef"><b>Definition:</b> http_session_factory.h:37</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html">sock::http::HttpServer</a></div><div class="ttdoc">HTTP服务器 </div><div class="ttdef"><b>Definition:</b> http_server.h:27</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_afd6c916273b2c92b0b478722480c77b3"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#afd6c916273b2c92b0b478722480c77b3">sock::http::HttpServer::RequestHandler</a></div><div class="ttdeci">boost::function&lt; void(const HttpRequestPtr &amp;, const HttpResponsePtr &amp;, RequestCompletedFN)&gt; RequestHandler</div><div class="ttdef"><b>Definition:</b> http_server.h:31</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a480de2e6bc2bf1020080da6bc270f52d"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a480de2e6bc2bf1020080da6bc270f52d">sock::http::HttpServer::open</a></div><div class="ttdeci">bool open(const char *addr, int port, int backlog)</div><div class="ttdoc">打开服务器 </div><div class="ttdef"><b>Definition:</b> http_server.cc:36</div></div>
<div class="ttc" id="namespacesock_html"><div class="ttname"><a href="namespacesock.html">sock</a></div><div class="ttdef"><b>Definition:</b> atomic.h:17</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_af09722646b93b373a1b79d6b9a806093"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#af09722646b93b373a1b79d6b9a806093">sock::http::HttpServer::setRequestParser</a></div><div class="ttdeci">void setRequestParser(HttpRequestParserPtr parser)</div><div class="ttdoc">设置请求解析器 </div><div class="ttdef"><b>Definition:</b> http_server.h:94</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_afcf96c05483817ee22bd4969bb0c7339"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#afcf96c05483817ee22bd4969bb0c7339">sock::http::HttpServer::setSessionFactory</a></div><div class="ttdeci">void setSessionFactory(HttpSessionFactoryPtr factory)</div><div class="ttdoc">设置SESSION工厂 </div><div class="ttdef"><b>Definition:</b> http_server.h:82</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a860fd0abc2724910c69ef3629c534b2c"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a860fd0abc2724910c69ef3629c534b2c">sock::http::HttpServer::RequestCompletedFN</a></div><div class="ttdeci">boost::function&lt; void(const HttpRequestPtr &amp;, const HttpResponsePtr &amp;)&gt; RequestCompletedFN</div><div class="ttdef"><b>Definition:</b> http_server.h:30</div></div>
<div class="ttc" id="http__session__factory_8h_html"><div class="ttname"><a href="http__session__factory_8h.html">http_session_factory.h</a></div></div>
<div class="ttc" id="namespacesock_1_1net_html_a2ddc58693b405832076a3d76dc133671"><div class="ttname"><a href="namespacesock_1_1net.html#a2ddc58693b405832076a3d76dc133671">sock::net::TcpConnectionFactoryPtr</a></div><div class="ttdeci">boost::shared_ptr&lt; TcpConnectionFactory &gt; TcpConnectionFactoryPtr</div><div class="ttdef"><b>Definition:</b> tcp_connection_factory.h:39</div></div>
<div class="ttc" id="classsock_1_1net_1_1_tcp_server_html"><div class="ttname"><a href="classsock_1_1net_1_1_tcp_server.html">sock::net::TcpServer</a></div><div class="ttdef"><b>Definition:</b> tcp_server.h:29</div></div>
<div class="ttc" id="http__request__parser_8h_html"><div class="ttname"><a href="http__request__parser_8h.html">http_request_parser.h</a></div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a673124e65ae935396d49293dfba7a186"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a673124e65ae935396d49293dfba7a186">sock::http::HttpServer::run</a></div><div class="ttdeci">void run(void)</div><div class="ttdoc">运行服务器 </div><div class="ttdef"><b>Definition:</b> http_server.cc:42</div></div>
<div class="ttc" id="structsock_1_1http_1_1_http_server_1_1_statics_html_a693fd63e87979b48a3553e61d4db10ca"><div class="ttname"><a href="structsock_1_1http_1_1_http_server_1_1_statics.html#a693fd63e87979b48a3553e61d4db10ca">sock::http::HttpServer::Statics::tcpServerStatics</a></div><div class="ttdeci">sock::net::TcpServer::Statics tcpServerStatics</div><div class="ttdef"><b>Definition:</b> http_server.h:38</div></div>
<div class="ttc" id="http__request__factory_8h_html"><div class="ttname"><a href="http__request__factory_8h.html">http_request_factory.h</a></div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_a34320f47f8e0b53b73d391d7be5d19b1"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#a34320f47f8e0b53b73d391d7be5d19b1">sock::http::HttpServer::getTcpServer</a></div><div class="ttdeci">sock::net::TcpServer &amp; getTcpServer(void)</div><div class="ttdoc">获取内部TCP服务器 </div><div class="ttdef"><b>Definition:</b> http_server.h:76</div></div>
<div class="ttc" id="classsock_1_1http_1_1_http_server_html_ab0f2bba4a15f790e18d186836d660f37"><div class="ttname"><a href="classsock_1_1http_1_1_http_server.html#ab0f2bba4a15f790e18d186836d660f37">sock::http::HttpServer::setRequestHandler</a></div><div class="ttdeci">void setRequestHandler(RequestHandler handler)</div><div class="ttdoc">设置请求处理器 </div><div class="ttdef"><b>Definition:</b> http_server.h:100</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
